package com.hsxc.cdz.mgmt.station;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.hsxc.cdz.base.bean.Address;
import com.hsxc.cdz.base.bean.Bill;
import com.hsxc.cdz.base.bean.Count;
import com.hsxc.cdz.base.bean.Pile;
import com.hsxc.cdz.base.dao.CountDao;

@Service
public class CountManager {
	private Logger logger = LoggerFactory.getLogger(CountManager.class);
	@Autowired
	private CountDao countDao;
	/**
	 * 更具地址获取电站数量
	 * @param address
	 * @return
	 */
	public List<Count> getCount(Address address){
		return countDao.selectCount(address);
	}
	/**
	 * 获取电桩各状态的数量
	 * @param operatorNo
	 * @return
	 */
	public List<Count> getPileCount(String operatorNo,String stationNo){
		Pile pile = new Pile();
		pile.setOperatorNO(operatorNo);
		pile.setStationNO(stationNo);
		return countDao.selectPileCount(pile);
	}
//	public List<Count> getPileCountByPileNos(List<String> pileNOs){
//		List<Count> bills = new ArrayList<>();
//		for (Iterator<String> iterator = pileNOs.iterator(); iterator.hasNext();) {
//			String pileNO = iterator.next();
//
//			bills = getBillsByPileNO(pileNO);
//
//			bills.addAll(bills);
//			System.out.println("bills" + bills);
//
//		}
//		return bills;
//	}
	public List<Count> getPaywayCount(String operatorNo){
		return countDao.selectPayWayCount(operatorNo);
	}
	public List<Count> selectMoneyCount(String comuserName){
		return countDao.selectMoneyCount(comuserName);
	}
}
